refactoring to more real app