proper refactoring and doing some renaming