Clean code

Relates #330