some refactoring done on functions and aliases