Cleaned up code for pushing to server