refactored and added more functions