major refactoring to resemble package structure