Adding pragma marks and some comments for refactoring