Refactor side code