refactored interface to allow for nicer code