Grouped functions together. Further refactoring required.