Refactored method names and fixed compilation errors