Refactor, make it more or less good-looking