Refactor variables. Clean code. Add test