refactored angular and css code