Refactored source code