Fix initial text layer positon issue
Refactor code