[Refactoring] Move code block for readability