Cleaned up code to make it more direct from readers