* heavy refactoring