Refactoring to make it more Flasy