Initial changes done for supporting custom profiles, only reording the initialization needed