refactoring beta stage (no more compile errors)