refactoring to the code, cleaned up style and markup