refactored code, css fixes