Cleaned up code and reorganized markup layout