Code refactoring and workaround for issue 1