Code refactoring; removing compilation warnings