emergency refactoring!!!