added trim functionalities along with startswith and endswith; refactored files