reduced reflection, added params, major refactoring