A bit of refactoring on importing in flask way