needs refactoring for usability