Refactor methods for better readability

Refactor methods for better readability