Proposes solution to prevent FOUC + Refactoring code