Cleaned up couple functions.