refactored code to be more semantic and according to HCA styles