made some proper abstraction