Cleaned up code to follow project code style